﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YYSite.Common;
using YYSite.Common.Domain;
using YYSite.Common.Logging;
using YYSite.Domain.System.Roles;

namespace YYSite.Application.System.Roles
{
    public class RoleService : ApplicationService,IRoleService
    {
        public RoleService(ILogger logger,IRoleRepository roleRepository):base(logger)
        {
            RoleRepository = roleRepository;
        }

        protected IRoleRepository RoleRepository { get; }

        public void CreateRole(Role input)
        {
            this.RoleRepository.Create(input);
            this.RoleRepository.Flush();
        }

        public DataGridOutput<Role> GetRoleByPage(GetRoleDataGridInput input)
        {
            return this.RoleRepository.GetRoleByPage(input);
        }
    }
}


